package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;
@Data
@ApiModel(value = "采购订单")
@TableName("t_buy_order")
public class BuyOrderBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_buyOrderId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "采购时间")
    @TableField("o_date")
    private LocalDate date=LocalDate.now();
    @ApiModelProperty(value = "供应商名字")
    @TableField("o_supplierName")
    private String supplierName;
    @ApiModelProperty(value = "采购人名字")
    @TableField("o_buyName")
    private String buyName;

    @TableField(exist = false)
    private List<BuyDetailBean> detailList; /**订单明细 集合 */

    public BuyOrderBean() {
    }

    public BuyOrderBean(String supplierName, String buyName) {
        this.supplierName = supplierName;
        this.buyName = buyName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getBuyName() {
        return buyName;
    }

    public void setBuyName(String buyName) {
        this.buyName = buyName;
    }

    public List<BuyDetailBean> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<BuyDetailBean> detailList) {
        this.detailList = detailList;
    }


    @Override
    public String toString() {
        return "BuyOrderBean{" +
                "id=" + id +
                ", date=" + date +
                ", supplierName='" + supplierName + '\'' +
                ", buyName=" + buyName +
                ", detailList=" + detailList +
                '}';
    }
}
